<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\Pjax;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\SchoolSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Schools';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="school-index">

    <?php Pjax::begin(); ?>
        <div class="panel">
            <div class="panel-heading panel-heading-auto">
                    <?php echo $this->render('_search', ['model' => $searchModel]); ?>
            </div>
            <div class="panel-body">

                <div style="margin-bottom: 10px">
                    <?= Html::a('新增', ['create'], ['class' => 'btn btn-success']) ?>
                </div>

                <?= GridView::widget([
                    'layout' => "{items}\n{pager}",
                    'tableOptions' => ['class' => 'table table-hover table-bordered'],
                    'dataProvider' => $dataProvider,
                    //'filterModel' => $searchModel,
                    'rowOptions' => function($model, $key, $index, $grid) {
                        return [
                            'style' => [
                                'color' => $model->ZT == '待审核' ? 'red' : '',
                                'display' => $model->showTableRows($model),
                            ],
                        ];
                    },
                    'columns' => [
                        ['class' => 'yii\grid\SerialColumn', 'header' => '序号'],

                        //'ID',
                        //'DM',
                        'ZWMC',
                        //'YWMC',
                        //'JC',
                        //'DZDM',
                        'CS',
                        'QX',
                        'DZ',
                        //'SDJYBMDM',
                        //'SDJYBMMC',
                        //'XZQHM',
                        //'ZDCXLX',
                        //'JBZMC',
                        //'BXLB',
                        //'SSMZXX',
                        //'XXLB',
                        //'FSBLX',
                        //'FRZSH',
                        //'FRDBMC',
                        //'FZRXM',
                        //'FZRLXDH',
                        //'JXNY',
                        //'LXDH',
                        //'CZDH',
                        //'ZYDZ',
                        //'YZBM',
                        //'DZXX',
                        //'PGLX',
                        //'SFJLXYW',
                        'ZGLB',
                        //'XXBB',
                        //'SZDQLB',
                        //'XZXM',
                        //'XZSJH',
                        //'XJLXR',
                        //'XJLXDH',
                        //'ZSZXDH',
                        //'ZSZXYX',
                        //'JJ:ntext',
                        'ZT',

                        [
                          'class' => 'yii\grid\ActionColumn',
                          'header'=>'操作',
                          'template' => '{view} {delete}',
                        ],
                    ],
                ]); ?>

            </div>
        </div>
    <?php Pjax::end(); ?>

</div>
